package wjh.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import wjh.pojo.Department;

import java.util.List;

@Repository
public interface wyDepartmentMapper {
     List<Department> like(@Param("likename") String likename);


    @Select("select *from department")
    List<Department> findAll();

    @Insert("insert into department values (null,#{department_name},#{department_introduction})")
    void addDepartment(Department department);

//  @Update("UPDATE department SET department_name = #{departmentName}, department_introduction = #{departmentIntroduction} WHERE id = #{id}")
    int updateDepartment(Department department);
    @Select("DELETE FROM department WHERE id=#{value}")
    void deleteDepartmentByid(Integer id);
@Select("select * from department where id=#{value}")
    Department findDepartmentById(int id);

    @Select("select id from department where department_name=#{value}")
    int findIdByName(String department);
}
